<?php


namespace app\api\auth;

use tauthz\facade\Enforcer;

class User
{
    /*
     * id
     */
    protected $id = null;

    /*
     * data
     */
    protected $data = [];

    //token
    protected $token_info = [];

    /*
     * 设置 id
     */
    public function withId($id): User
    {
        $this->id = $id;

        return $this;
    }

    /*
     * 获取 id
     */
    public function getId()
    {
        return $this->id;
    }

    /*
     * 设置 data
     */
    public function withData($data): User
    {
        $this->data = $data;

        return $this;
    }

    /**
     * 解密后的token
     * @param [type] $token_info
     * @return void
     * @author Sam
     */
    public function setToken($token_info){
        $this->token_info = $token_info;
        return $this;
    }

    //获取解密后的token
    public function getToken($token_info){
        return  $this->token_info;
    }

    /*
     * 获取 data
     */
    public function getData()
    {
        return $this->data;
    }

}
